|
|
|
|
|
|
|
(table continued from previous page) |
|
|
|
|
| Column Name | Description | | Report Desc | Contains the description of the report | | Report Filename | | | Report Sort Order | Defines the sort position of the report in the display list and allows you to reorder the report list when needed |
|
|
|
|
|
|
By looking at the information in Table 8.2, notice that only the information that can occur in multiples has been placed in their own tables. Any other information related to the address book entry is contained in the primary or master table. Also, the reports table is used only by the reporting dialog form to display the available reports to users. Finally, you should also notice that each table has two types of key fields in them: one used for system control of the records, and one used to define the relationships between tables. |
|
|
|
|
|
|
|
|
The indexes that you define for the database tables are directly related to the types of searches you'll allow users to perform in the application. If you don't define indexes, application performance slows as the database grows because, during table searches, if the field being searched isn't indexed, the database engine will have to read the entire table to find matching records. Imagine looking for a name in a phone book that isn't in alphabetical order. You would have to read every name in the book looking for the one you wanted. But with the top-of-page indexing that the phone books usually have, finding a name is easy and quick. Database indexes work the same way. |
|
|
|
|
|
|
|
|
When working with indexes, don't forget that sometimes you'll need to use more than one column to create a unique index value. In this application, what happens if two people have the same last name, such as Smith? You would then need to look at the first name to see which is the one you wanted. So, for the application, you need to create at least six indexes, one for each table. For the three supporting tables, the index should be on the Entry Fkey field, which relates the record to a given address entry. Therefore, all records with the same key value should be grouped together. For the primary table, you should start by creating an index on the first and last name fields individually, and on one by using the first and last name fields together. |
|
|
|
|
|
|
|
|
When combining fields into one index, it's important to remember that the order they're listed in the index affects the way the index will work. |
|
|
|
|
|
|
|
|
If the index is created with the two fields in the wrong order, the returned query result will have incorrect information. For this application, add the indexes listed in Table 8.3 for much better performance when accessing the tables. |
|
|
|
|
|